const mixin = {
  data() {
    return {
      msg: "data"
    }
  },
  methods: {
    toUrl(str){   
      var lastSlashIndex = str.lastIndexOf("/");
      var secondLastSlashIndex = str.lastIndexOf("/", lastSlashIndex - 1); // 在最后一个斜杠之前搜索斜杠的位置
      var url = str.substring(secondLastSlashIndex + 1);
      return url;
    },
		// 获取当前年月日
		getDate() {
			const date = new Date()
			var year = date.getFullYear()
			var month = date.getMonth() + 1
			var day = date.getDate()
			month = month > 9 ? month : '0' + month
			day = day < 10 ? '0' + day : day
			var today = year + month + day
			return today
		},    
  }
}
export default mixin;
